
import 'package:flutter/cupertino.dart';
import 'package:imember/Util/Global.dart';
import 'package:imember/Util/MyColor.dart';
import 'package:imember/Widget/MyImage.dart';

/// 小鈴鐺
class Notice extends StatefulWidget {
  Function() onClose;

  Notice({required this.onClose});

  @override
  State<StatefulWidget> createState() {
    return NoticeState();
  }
}

class NoticeState extends State<Notice> {
  @override
  Widget build(BuildContext context) {
    return Container(
        width: 314,
        margin: EdgeInsets.fromLTRB(300, 100, 0, 200),
        decoration: Global.getBoxBg(8, MyColor.White),
        child: Column(children: [
          Container(
              height: 34,
              alignment: Alignment.center,
              decoration: BoxDecoration(color: MyColor.Orange, borderRadius: BorderRadius.vertical(top: Radius.circular(8))),
              child: Text("通知", style: TextStyle(fontSize: 17, color: MyColor.White))),
          Expanded(
              child: ListView.builder(
                  padding: EdgeInsets.all(0),
                  itemCount: 4,
                  itemBuilder: (BuildContext context, int index) {
                    return ItemNotice();
                  }))
        ]));
  }
}

class ItemNotice extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
        child: Column(
          children: [
            Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
              LocalImage("ic_order_notice.png", width: 50, height: 50, padding: EdgeInsets.fromLTRB(12, 20, 12, 16)),
              Expanded(
                  child: Container(
                      padding: EdgeInsets.only(right: 10),
                      child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
                        Container(height: 22),
                        Text("訂單通知", style: TextStyle(fontSize: 13, color: MyColor.C58)),
                        Text("您有一筆新的外送訂單00400500，請盡速確認並準備。", style: TextStyle(fontSize: 10, color: MyColor.C81)),
                      ])))
            ]),
            Container(height: 1, color: MyColor.DD, margin: EdgeInsets.fromLTRB(11, 0, 11, 0))
          ],
        ));
  }
}